﻿using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;

namespace FanaticRock.Controls
{
    ///<summary>播放列表。</summary>
    [ContentProperty(nameof(HoverContent))]
    [DefaultProperty(nameof(HoverContent))]
    public class PlayListItem : Control
    {
        #region props

        public Brush CoverBrush
        {
            get { return (Brush)GetValue(CoverBrushProperty); }
            set { SetValue(CoverBrushProperty, value); }
        }

        // Using a DependencyProperty as the backing store for CoverBrush.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty CoverBrushProperty =
            DependencyProperty.Register("CoverBrush", typeof(Brush), typeof(PlayListItem), new PropertyMetadata(null));


        public int IndexFromCollection
        {
            get { return (int)GetValue(IndexFromCollectionProperty); }
            set { SetValue(IndexFromCollectionProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IndexFromCollection.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IndexFromCollectionProperty =
            DependencyProperty.Register("IndexFromCollection", typeof(int), typeof(PlayListItem), new PropertyMetadata(0));




        public string Title
        {
            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Title.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TitleProperty =
            DependencyProperty.Register("Title", typeof(string), typeof(PlayListItem), new PropertyMetadata(null));




        public string OriginTitleProperty
        {
            get { return (string)GetValue(OriginTitlePropertyProperty); }
            set { SetValue(OriginTitlePropertyProperty, value); }
        }

        // Using a DependencyProperty as the backing store for OriginTitleProperty.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty OriginTitlePropertyProperty =
            DependencyProperty.Register("OriginTitleProperty", typeof(string), typeof(PlayListItem), new PropertyMetadata(null));



        public string Information
        {
            get { return (string)GetValue(InformationProperty); }
            set { SetValue(InformationProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Information.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty InformationProperty =
            DependencyProperty.Register("Information", typeof(string), typeof(PlayListItem), new PropertyMetadata(null));


        public TimeSpan TotalTime
        {
            get { return (TimeSpan)GetValue(TotalTimeProperty); }
            set { SetValue(TotalTimeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TotalTime.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TotalTimeProperty =
            DependencyProperty.Register("TotalTime", typeof(TimeSpan), typeof(PlayListItem), new PropertyMetadata(TimeSpan.Zero));


        public object HoverContent
        {
            get { return (object)GetValue(HoverContentProperty); }
            set { SetValue(HoverContentProperty, value); }
        }

        // Using a DependencyProperty as the backing store for HoverContent.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty HoverContentProperty =
            DependencyProperty.Register("HoverContent", typeof(object), typeof(PlayListItem), new PropertyMetadata(null));




        public string AlbumTitle
        {
            get { return (string)GetValue(AlbumTitleProperty); }
            set { SetValue(AlbumTitleProperty, value); }
        }

        // Using a DependencyProperty as the backing store for AlbumTitle.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty AlbumTitleProperty =
            DependencyProperty.Register("AlbumTitle", typeof(string), typeof(PlayListItem), new PropertyMetadata(null));




        public bool IsLike
        {
            get { return (bool)GetValue(IsLikeProperty); }
            set { SetValue(IsLikeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsLike.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsLikeProperty =
            DependencyProperty.Register("IsLike", typeof(bool), typeof(PlayListItem), new PropertyMetadata(null));


        public bool IsDownloadCompleted
        {
            get { return (bool)GetValue(IsDownloadCompletedProperty); }
            set { SetValue(IsDownloadCompletedProperty, value); }
        }

        // Using a DependencyProperty as the backing store for IsDownloadCompleted.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty IsDownloadCompletedProperty =
            DependencyProperty.Register("IsDownloadCompleted", typeof(bool), typeof(PlayListItem), new PropertyMetadata(false));


        #endregion

        #region commands



        public ICommand PlayCommand
        {
            get { return (ICommand)GetValue(PlayCommandProperty); }
            set { SetValue(PlayCommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for PlayCommand.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PlayCommandProperty =
            DependencyProperty.Register("PlayCommand", typeof(ICommand), typeof(PlayListItem), new PropertyMetadata(null));




        #endregion

    }
}
